package org.taobao.api
{
    import flash.events.EventDispatcher;
    
    import org.taobao.api.vo.User;
    
    
    [Event(name="loginSuccess", type="flash.events.Event")]
    [Event(name="loginFail", type="flash.events.Event")]
    
    public class UserSession extends EventDispatcher
    {
        public static const EVENT_LOGIN_SUCCESS:String = "loginSuccess";
        public static const EVENT_LOGIN_FAIL:String = "loginFail";
        public function UserSession(isSandboxFlag:Boolean = true)
        {
            isSandbox = isSandboxFlag;
        }
        /****
        * The flag to indicate whether it is sandbox environment or production environment
        */ 
        private var isSandbox_:Boolean;
        public function set isSandbox(value:Boolean):void {
            isSandbox_ = value;
        }
        public function get isSandbox():Boolean {
            return isSandbox_;
        }
        
        private var user_:User;
        public function get user():User {
            return user_;
        }
        
        /***
        * 
        */ 
        public function login(username:String, password:String):void {
            // TODO: REST API invocation
            this.dispatchEvent(new Event(EVENT_LOGIN_SUCCESS));
        }
        
        public function getProductService():void {
            
        }
        
        public function getCategoryService():void {
            
        }
        
        public function getItemService():void {
            
        }
        
        public function getTaoBaoKeService():void {
            
        }
        
        public function getTradeService():void {
            
        }
        
        public function getRateService():void {
            
        }
        
        public function getShippingService():void {
            
        }
        
        public function getShopService():void {
            
        }
        
        public function getJiangHuService():void {
            
        }
        
        public function getPictureService():void {
            
        }
    }
}